<?php
include "config.php";

	$passwordbaru = $_POST['passwordbaru'];
	$konfirmasipassword = $_POST['konfirmasipassword'];
	$email = $_POST['email'];

$cekuser = " SELECT * FROM datauser where email = '$email'";
$querycekuser = mysql_query($cekuser);

$count = mysql_num_rows($querycekuser);

if ($count >= 1){

$updatepassword = " update datauser set password = md5('$passwordbaru') where email = '$email'";
$updatequery = mysql_query($updatepassword);

if($updatequery)
{
	header('location:lupapassword2.php');
}

}
else 
		{header('location:lupapassword3.php');
}
?>
